import os
import configparser


# 获取配置
current_path = os.path.abspath(".")
config = configparser.ConfigParser()
config.read(os.path.join(current_path,"settings.ini"))

mysql_conf = dict(
    host=config["MYSQL"]["HOST"],
    port=int(config["MYSQL"]["PORT"]), # 注意这里得把port转换成int！
    user=config["MYSQL"]["USER"],
    password=config["MYSQL"]["PASSWORD"],
    database=config["MYSQL"]["DATABASE"],
    charset=config["MYSQL"]["CHARSET"],
)
print("mysql_conf: ", mysql_conf)